package GUI.Paint;

import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class TextPaint {
    public static void main(String[] args) {
       new MyPaint().loadFrame();
    }
}

class MyPaint extends Frame {
    public void loadFrame() {
        setBounds(400,250,300,300);
        addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });
        setVisible(true);
    }
    //画笔
    @Override
    public void paint(Graphics g) {
        //super.print(g);
        g.setColor(new Color(0x05FAD7));        //画笔需要有颜色
        g.drawOval(100,100,50,50);      //画笔可以画圆
        g.setColor(Color.GREEN);
        g.fillOval(100,150,50,50);      //画实心圆
        g.setColor(Color.YELLOW);
        g.fillRect(150,100,100,100);
        //画笔用完还原最初yans
    }
}
